/* $Id: InfoDialog.java 39 2009-07-24 22:48:06Z h_m_r@gmx.de $ */
package org.jugger.tournament.gui;

import java.awt.Component;
import java.awt.Frame;

import javax.swing.ImageIcon;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JOptionPane;

import util.I18N;
import util.MediaManager;

public class InfoDialog extends JDialog {

	private static final long serialVersionUID = 43304651907124233L;

	private static InfoDialog dialog;

    /**
     * Set up and show the dialog.  The first Component argument
     * determines which frame the dialog depends on; it should be
     * a component in the dialog's controlling frame. The second
     * Component argument should be null if you want the dialog
     * to come up with its left corner in the center of the screen;
     * otherwise, it should be the component on top of which the
     * dialog should appear.
     */
    public static void showDialog(Component frameComp,
                                    Component locationComp) {
        Frame frame = JOptionPane.getFrameForComponent(frameComp);
        dialog = new InfoDialog(frame,
                                locationComp);
        dialog.setVisible(true);
    }

    private InfoDialog(Frame frame,
                       Component locationComp) {
        super(frame, I18N.__("dialogTitleInfo"), true);

        pack();
        setSize(350, 195);
        setLocationRelativeTo(locationComp);

        add(new JLabel(MediaManager.getImageIcon("images/info_title.png")));
        setResizable(false);
    }
}
